package com.gtw.modules.api.controller;

import com.gtw.common.annotation.AuthIgnoreApi;
import com.gtw.utils.UrlUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

/**
 * Created by wuye on 2018/3/23.
 */
@RestController
@RequestMapping("/api/routin")
public class ApiRoutingController {

    /**
     *
     * @return
     */
    @AuthIgnoreApi
    @GetMapping("/routing")
    public ModelAndView routing(@RequestParam String url){
        String path = UrlUtil.getURLDecoderString(url);
        System.out.println(path);

        return new ModelAndView("redirect:"+path);
    }
}
